VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Translate bin>hex and hex>bin again.

by Anonymous (267 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 12th June 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Translate bin>hex and hex>bin again.

Rate Translate bin>hex and hex>bin again.



  var %temp = $1-

  var %output
  while (%temp) {
    var %char = $chr($base($left(%temp,8),2,10))

    %output = %output $+ $iif(%char == $chr(32),$chr(1),%char)
    %temp = $right(%temp,-8)
  }

  return $replace(%output,$chr(1),$chr(32))
}

alias bin.encode {
  var %output
  var %temp = $1-

  while (%temp) {
    %output = %output $+ $base($asc($left(%temp,1)),10,2,8)

    %temp = $right(%temp,-1)
  }

  return %output
}

Download this snippet    Add to My Saved Code

Translate bin>hex and hex>bin again. Comments

No comments have been posted about Translate bin>hex and hex>bin again.. Why not be the first to post a comment about Translate bin>hex and hex>bin again..

Post your comment

Subject:
Message:
0/1000 characters